
//--------------------------------------------------------------------//
//     此代码由T4模板自动生成										  //
//	   生成时间 2020-06-22 10:21:10 	                              //
//	   描述：编号规则表
//--------------------------------------------------------------------//

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using RayD.Core;

namespace RayD.Repository.Entites.SystemModule
{	
    [Table("BASE_CODERULE")]
	public class CodeRuleEntity
	{
        #region 实体成员
		/// <summary>
		/// 编码规则主键
		/// </summary>
		/// <returns></returns>
		[Key]
		[Column("B_RULEID")]
		public string B_RuleId { get; set; }
		/// <summary>
		/// 编号
		/// </summary>
		/// <returns></returns>
		[Column("B_ENCODE")]
		public string B_EnCode { get; set; }
		/// <summary>
		/// 名称
		/// </summary>
		/// <returns></returns>
		[Column("B_NAME")]
		public string B_Name { get; set; }
		/// <summary>
		/// 当前流水号
		/// </summary>
		/// <returns></returns>
		[Column("B_NEXTNUMBER")]
		public string B_NextNumber { get; set; }
		/// <summary>
		/// 备注
		/// </summary>
		/// <returns></returns>
		[Column("B_DESCRIPTION")]
		public string B_Description { get; set; }
		/// <summary>
		/// 创建日期
		/// </summary>
		/// <returns></returns>
		[Column("B_CREATEDATE")]
		public DateTime? B_CreateDate { get; set; }
		/// <summary>
		/// 创建用户主键
		/// </summary>
		/// <returns></returns>
		[Column("B_CREATEUSERID")]
		public string B_CreateUserId { get; set; }
		/// <summary>
		/// 创建用户
		/// </summary>
		/// <returns></returns>
		[Column("B_CREATEUSERNAME")]
		public string B_CreateUserName { get; set; }
		/// <summary>
		/// 修改日期
		/// </summary>
		/// <returns></returns>
		[Column("B_MODIFYDATE")]
		public DateTime? B_ModifyDate { get; set; }
		/// <summary>
		/// 修改用户主键
		/// </summary>
		/// <returns></returns>
		[Column("B_MODIFYUSERID")]
		public string B_ModifyUserId { get; set; }
		/// <summary>
		/// 修改用户
		/// </summary>
		/// <returns></returns>
		[Column("B_MODIFYUSERNAME")]
		public string B_ModifyUserName { get; set; }
 
        #endregion
		
        #region 扩展操作
		/// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
			UserInfo userInfo = AuthenticationHelper.LoginUserInfo;
			this.B_RuleId = Guid.NewGuid().ToString();
			this.B_CreateDate = DateTime.Now.ToCstTime();
			this.B_CreateUserId = userInfo.userId;
			this.B_CreateUserName = userInfo.realName;
			this.B_ModifyDate = DateTime.Now.ToCstTime();
			this.B_ModifyUserId = userInfo.userId;
			this.B_ModifyUserName = userInfo.realName;
		}
        /// <summary>
        /// 编辑调用
        /// </summary>
        public void Modify()
        {
			UserInfo userInfo = AuthenticationHelper.LoginUserInfo;
			this.B_ModifyDate = DateTime.Now.ToCstTime();
			this.B_ModifyUserId = userInfo.userId;
			this.B_ModifyUserName = userInfo.realName;
        }
        #endregion
    }
}

